﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 多态2
{
    class Area
    {
        static  void Main(string [] args) {
            Console.WriteLine("计算圆的面积请按1    计算正方形的面积请按2");
            int x = int.Parse(Console.ReadLine());
            if (x == 1) {
                Circle circle = new Circle();
                Console.WriteLine("请输入圆的半径：");
                int r = int.Parse(Console.ReadLine());
                circle.radius = r;
                circle.GetArea(r);
            }
            else if(x==2)
            {
                Square  square = new Square();
                Console.WriteLine("请输入正方形的边长：");
                int l = int.Parse(Console.ReadLine());
                square.GetArea(l);
            }
        }
    }
}
